
import fetch from '../../utils/http/fetch.js'
import consts from '../../utils/http/consts.js'

const ROOT = './cs/ad';

export default {
  reset(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/reset`);
  },
  login(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/login/code`);
  },
  smsotp(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/login/smsotp`);
  },
  pwd(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/login/pwd`);
  },
  get(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/myself`);
  },
  list(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/list`);
  },
  new(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/new`);
  },
  update(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/update`);
  },
  page(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/page`);
  },
  delete(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/delete`);
  },
  saveList(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/save-list`);
  },
  sort(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/sort`);
  },
  saveMenu(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/menu`);  // 保存勾选菜单
  },
  code(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/code`); // 获取验证码
  },
  check(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/check`); // 校验验证码
  },
  exist(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/exist`); // 是否存在
  },
  idaas_login(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/idaas_login`); // 是否存在
  },
  idaas_callbak(data, suc, err) {
    return fetch(data, suc, err, consts.HttpMethod.POST, `${ROOT}/idaas/callback`); // idass 回调登录
  },
}
